<?php
header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Methods:POST,GET,OPTIONS,DELETE');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Headers: Content-Type,Content-Length,Accept-Encoding,X-Requested-with, Origin');
include("../jsondecode_inc.php");
$html=file_get_contents("https://weathernew.pae.baidu.com/weathernew/pc?query={$_REQUEST['city']}天气&srcid=4982&forecast=long_day_forecast");
preg_match("/tplData\s*=\s*?(.*);<\/script>/Uisx",$html,$nn);
$data=nodecode(trim($nn[1]));
if($_REQUEST['callback']!=""){
    echo $_REQUEST['callback']."(".json_encode($data).");";
}else {
    echo json_encode($data);
}